function EFFECT:Init(data)

	self.Heirach = data:GetEntity()
	self.Color = Color(data:GetStart().x, data:GetStart().y, data:GetStart().z, data:GetMagnitude())
	self.Size = data:GetRadius()
	self.Offset = data:GetOrigin()

	self.SpriteMode = data:GetScale()
	
	if (self.SpriteMode == 1) then
		self.Mat = Material("Sprites/animglow02")
	elseif (self.SpriteMode == 2) then
		self.Mat = Material("Sprites/glow01")
	elseif (self.SpriteMode == 3) then
		self.Mat = Material("Sprites/glow1")
	elseif (self.SpriteMode == 4) then
		self.Mat = Material("Sprites/glow06")
	elseif (self.SpriteMode == 5) then
		self.Mat = Material("Sprites/lamphalo1")
	elseif (self.SpriteMode == 6) then
		self.Mat = Material("Sprites/light_glow01")
	elseif (self.SpriteMode == 7) then
		self.Mat = Material("effects/strider_pinch_dudv")
	elseif (self.SpriteMode == 8) then
		self.Mat = Material("Sprites/blueflare1")
	end
	
	if (self.SpriteMode != 7) then
		self.Mat:SetMaterialInt("$spriterendermode",5)
		--self.Mat:SetMaterialInt("$ignorez",1)
		self.Mat:SetMaterialInt("$illumfactor",8)
	end
	
	local boundlimit = Vector(32768,32768,32768)
	self.Entity:SetRenderBoundsWS(-1*boundlimit,boundlimit)
end

function EFFECT:Think()
	if (self.Heirach:IsValid() and self.Heirach:GetNetworkedBool("Drawmodel")) then
		return true
	else
		return false
	end
end

function EFFECT:Render()
			
	render.SetMaterial(self.Mat)
	if self.SpriteMode == 7 then render.UpdateRefractTexture() end
	render.DrawSprite(self.Heirach:LocalToWorld(self.Offset), self.Size, self.Size, self.Color)
					 
end
